package cn.net.Stream;

import java.io.FileWriter;


import java.io.Writer;

public class Test {
    public static void main(String[] args) {
        Writer out = null;//声明变量,默认初始值为null;
        try {
            out = new FileWriter("D:\\File\\abc.txt");//创建对象，生成心文件n
            out.append("aaaa");
            out.write("1234567",3,4);//字符串7位数==3+4
            out.write(" ",0,0);
        } catch (Exception e) {
            e.printStackTrace();
        }finally {
            try {
                out.close();//释放资源
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
}
